package main

import (
	"encoding/json"
	"fmt"
)

type SrsKbps struct {
	Recv30s int `json:"recv_30s"`
	Send30s int `json:"send_30s"`
}

type SrsStream struct {
	App     string  `json:"app"`
	Name    string  `json:"name"`
	Clients int     `json:"clients"`
	Kbps    SrsKbps `json:"kbps"`
}

type SrsApiResponse struct {
	Code    int         `json:"code"`
	Streams []SrsStream `json:"streams"`
}

func main() {
	fmt.Println("Hello World!")
	var res SrsApiResponse
	res.Code = 1
	res.Streams = []SrsStream{}
	var element SrsStream
	// element.App = "test"
	// element.Name = "test"
	// element.Clients = 1
	// element.Kbps.Recv30s = 1
	// element.Kbps.Send30s = 1
	res.Streams = append(res.Streams, element)
	data, _ := json.Marshal(res)
	fmt.Println(string(data))
}
